/**
 * Author:yuiop
 * Date:2022/3/29 15:20
 */
package com.devops.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.devops.admin.model.DOSMenu;
import com.devops.admin.po.DOSRoleMenuRelationPo;
import com.devops.admin.vo.DOSMenuVo;
import com.devops.shiro.vm.BaseUserVM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DOSMenuMapper extends BaseMapper<DOSMenu> {
    List<DOSMenu> getMenus(BaseUserVM baseUserVM);

    /**
     * @Author heyabo
     * @Description 获取角色绑定和未绑定的菜单
     * @Date 10:15 2022/8/30
     * @Param [roleId]
     * @return java.util.List<com.devops.admin.po.DOSRoleMenuRelationPo>
     **/
    List<DOSRoleMenuRelationPo> getBindMenus(Integer roleId,Integer isDel);

    /**
     * @Author heyabo
     * @Description 查询树形的菜单 - 向下查询子菜单
     * @Date 14:05 2022/8/30
     * @Param [menuIds]
     * @return java.util.List<com.devops.admin.model.DOSMenu>
     **/
    List<DOSMenu> getTreeMenus(List<Integer> menuIds);

    /**
     * @Author heyabo
     * @Description 查询当前节点和其父节点
     * @Date 14:44 2022/8/30
     * @Param [menuIds]
     * @return java.util.List<com.devops.admin.model.DOSMenu>
     **/
    List<DOSMenu> getPreTreeMenus(List<Integer> menuIds);

    /**
     * @Author heyabo
     * @Description 查询未添加的菜单
     * @Date 15:32 2022/8/30
     * @Param []
     * @return java.util.List<com.devops.admin.model.DOSMenu>
     **/
    List<DOSMenu> getNoAddMenus();

    /**
     * @Author heyabo
     * @Description 更新菜单
     * @Date 17:07 2022/8/30
     * @Param [menuVo]
     * @return boolean
     **/
    boolean updateMenu(DOSMenuVo menuVo);

    /**
     * @Author heyabo
     * @Description 根据名称查询菜单
     * @Date 17:58 2022/8/30
     * @Param [name]
     * @return com.devops.admin.model.DOSMenu
     **/
    DOSMenu getByName(String name);
    /**
     * @Author heyabo
     * @Description 将菜单的isDel全部设置为1
     * @Date 14:46 2022/9/1
     * @Param [menuIds]
     * @return void
     **/
    void updateMenuActive(List<Integer> menuIds);
    /**
     * @Author heyabo
     * @Description 删除菜单节点
     * @Date 09:38 2022/9/2
     * @Param [menuIdList]
     * @return void
     **/
    void removeByIdList(List<Integer> menuIdList);
}
